1. Field of the Invention
The present invention relates to an image processing device and a computer-readable storage medium on which an image processing program is recorded. More specifically, the present invention relates to an image processing method and device which quantizes input data into binary or multivalued data while maintaining the difference between an input image density and an output image density by an error diffusion method, as well as a computer-readable storage medium on which an image processing program for executing the image processing method is recorded.
2. Description of the Related Art
A pseudo halftone process conventionally represents input multivalued image data as binary image data or multivalued image data at a level lower than that of the input multivalued image data. The pseudo halftone process is a technique for converting an image represented at multivalued gray scales into an image represented at halftone gray scales using, for example, binary image data composed of only white and black points. A typical example of the pseudo halftone process is an error diffusion method. The error diffusion method is a technique for distributing an error resulting from a conversion of a target pixel to pixels adjacent to the target pixel; in this conversion, for example, multivalued image data is converted into monochromatic binary image data on the basis of a predetermined threshold. The error diffusion method enables halftones to be represented with the entire error reduced. That is, the error diffusion method distributes an error resulting from a conversion of multivalued image data into binary image data, to substantially zero accumulative errors in the colors of the entire image. With the error diffusion method, the target pixel and its density are defined as P and v, respectively. The densities of unbinarized pixels P0, P1, P2, and P3 present around the pixel P are defined as v0, v1, v2, and v3. A binarization threshold is defined as T. Empirically determined weight factors W0, W1, W2, and W3 are then used to weight a binarization error E at the target point P. The error is then distributed to peripheral pixels P0, P1, P2, and P3. That is, the error diffusion method makes the average density of an output image equal to the density of an input image. When output binary data is defined as o, the equations below determine errors E0, E1, E2, and E3 for the peripheral pixels P0, P1, P2, and P3.For v≧T, o=1, E=v−VmaxFor v<T, o=0, E=v−Vmin(Vmax: maximum density, Vmin: minimum density)E0=E×W0;E1=E×W1;E2=E×W2;E3=E×W3;(examples of the weight factor: W0= 7/16, W1= 1/16, W2= 5/16, W3= 3/16).
To output multivalued image data using a cyan (C), magenta (M), yellow (Y), or black (K) ink, color ink jet printers and the like conventionally use the error diffusion method or the like independently for each color to execute the pseudo halftone process. This enables each color to appear excellent but may fail to achieve a high image quality for two or more overlapping images.
Examples of prior techniques for solving this problem are described in, for example, Japanese Patent Laid-Open No. 8-279920 and Japanese Patent Laid-Open No. 11-10918. These prior examples disclose pseudo halftone processing methods of using an error diffusion method for a combination of two or more colors to achieve high visibility even for two or more overlapping colors. Japanese Patent Laid-Open No. 9-139841 discloses a method of independently executing a pseudo halftone process on two or more colors and then modifying an output value on the basis of the sum of input values; this method produces effects similar to those described above.
To reduce the granular feeling of an intermediate density area in a color image, it is effective to execute image processing so that dots of a cyan (C) and magenta (M) components do not overlap. To achieve this, the conventional technique uses a method of processing a color image shown below.
FIG. 8 is a diagram illustrating a conventional method of processing a color image.
In FIG. 8, the pixels and density components (YMCK) of color image data are each represented by 8-bit (gray scale value: 0 to 255) multivalued data. When the density values of a C and M components of an original image are defined as C and M, respectively, the density values Ct and Mt of a cyan (C) and magenta (M) components of an arbitrary target pixel in image data are expressed by equations shown below, where Ce and Me denote values resulting from error diffusion executed on the target pixel with the C and M components.Ct=C+Ce MT=M+Me 
The conventional method of processing a color image performs one of four image processing control operations shown below depending on the densities of C and M components of the target pixel. A threshold Th1=128 and a threshold Th2=255+Th1.
1. Dot printing is not executed if (Ct+Mt) is equal to or smaller than the threshold Th1, that is, if it belongs to an area 1 shown in FIG. 8.
2. Dot printing is executed using only the C ink if (Ct+Mt) exceeds the threshold Th1 and if (Ct+Mt) is equal to or smaller than the different threshold Th2 and if Ct>Mt, that is, if (Ct+Mt) belongs an area 2 in FIG. 8.
3. Dot printing is executed using only the M ink if (Ct+Mt) exceeds the threshold Th1 and if (Ct+Mt) is equal to or smaller than the different threshold Th2 and if Ct≦Mt, that is, if (Ct+Mt) belongs an area 3 in FIG. 8.
4. Dot printing is executed using the C and M inks if (Ct+Mt) exceeds the different threshold Th2, that is, if (Ct+Mt) belongs an area 4 in FIG. 8.
However, with the conventional image processing method, an increase in the number of gray scales consistently complicates the above judgment expressions, thus increasing the time required for processing. An algorithm is shown below which is used if, for example, cyan and magenta are quantized into three values using the conventional image processing method.
Ct = C + CeMt = M + MeCout = 0Mout = 0if(Ct + Mt) > Threshold1)if(Ct + Mt <Threshold2)if(Ct > Mt)Cout = 1elseMout = 1elseif{Ct + Mt < Threshold3)if(Ct > Mt + Const1)Cout = 2elseif(Mt < Ct + COnst1)Mout = 2elseCout = 1Mout = 1elseif(Ct + Mt < Threshold4)if(Ct > Mt)Cout = 2Mout = 1elseCout = 1Mout = 2elseCout = 2Mout = 2
Thus, the mere quantization of cyan and magenta into three values is a complicated process. Quantization into more gray scales requires a further complicated process.